javascript:
var AK = "UZsbXHXulSefKpKvXQxPOAWE";
var SK = "fjoFIyPSkP0rF0BHYIU7o0xujowVDHMz";

var token;
is_jQuery();function is_jQuery() {
    if (window.jQuery == undefined) {
        var add_jQuery = document.createElement('script');
        add_jQuery.src = "https://code.jquery.com/jquery-3.6.0.min.js";
        window.jQuery || document.getElementsByTagName('head')[0].appendChild(add_jQuery);
        setTimeout(is_jQuery, 200);
    } else {
        aianswer(token);
    }
}

function aianswer(token) {
	var nowtime = new Date().getTime();
	var question = $('.question-type').text()+$('.question-text').text();
	var select = $($('.question-item>div')[1]).text();
	console.log('问题',question);
	console.log('选项',select);
    $.ajax({
		timeout:30000,
        type: "POST",
        'url': 'https://qianfan.baidubce.com/v2/chat/completions',
        'headers': {
            'Content-Type': 'application/json',
			'Authorization': "Bearer bce-v3/ALTAK-Pw6DPeuJL6sbN1gjG4Gwv/2bd1ca79271b83dc76cb7a9ef5c4506843380c9e"
        },
        data: JSON.stringify({
                "model": "ernie-4.5-turbo-32k",
                "messages": [
						{
							"role": "system",
							"content": "你是一个答题助手，根据题目和选项，客观地选择出最为准确的答案选项，无需解析，选项用数字表示，比如第一个选项为0，第二个选项为1，第三个选项为2，以此类推。判断题对为0，错为1"
						},
                        {
                                "role": "user",
                                "content": "你是一个答题助手，根据题目：{"+question+"}，从选项{"+select+"}客观地选择出最为准确的答案选项，无需解析，选项用数字表示，比如第一个选项为0，第二个选项为1，第三个选项为2，以此类推。判断题对为0，错为1"
                        },
                ],
                "temperature": 0.2,
                "top_p": 0.5,
                "penalty_score": 1,
                "stop": [],
                "web_search": {
                        "enable": false,
                        "enable_trace": false
                }
        }),
        error: function (data) {
            console.log(JSON.stringify(data));
			console.log('AI请求答案失败了！');
        },
        success: function (data) {
			var time = new Date().getTime() - nowtime;
            //console.log(JSON.stringify(data));
			var text = data.choices && data.choices[0] && data.choices[0].message && data.choices[0].message.content
			console.log('耗时'+(time/1000).toFixed(2)+'s,获取到答案：'+text);
			$('title').text('耗时'+(time/1000).toFixed(2)+'s,获取到答案：:'+text);
			select_answer(text);
        }
    });
}
async function select_answer(answer) {
	answer = answer.toString();
	var list = $('.el-radio__original');
	var judge;
	if($('.el-radio__original') && $('.el-radio__original').length>0){
		list = $('.el-radio__original');
	}
	if($('.el-checkbox__original') && $('.el-checkbox__original').length>0){
		list = $('.el-checkbox__original');
	}
	if($('.judge-buttons>button') && $('.judge-buttons>button').length>0){
		list = $('.judge-buttons>button');
	}
	for(var i = 0;i<list.length;i++){
		var xx = i.toString();
		if(answer.match(xx)){
			if(list && $('.judge-buttons>button').length >0){
				$('.judge-buttons>button')[answer].click();
			}
			if(list[i].checked==false){
				console.log('选中',xx,$(list[i]).text());
				list[i].click();
			}else{
				console.log('已选中',xx,$(list[i]).text());
			}			
		}		
		await delay(50);
	}
	console.log('选择操作完成');
	setTimeout(()=>next(),100);
}

function delay(time) {
  return new Promise(resolve => setTimeout(resolve, time));
}
var stop = 0;
function next(){
	if(stop){return;}
	var dx = document.querySelector('input[class="el-radio__original"]:checked');
	var dd = document.querySelector('input[class="el-checkbox__original"]:checked');
	var judge = $('.judge-buttons>button') && $('.judge-buttons>button').length;
	if(($('.question-nav>button') && $('.question-nav>button').length>1 && $($('.question-nav>button')[1]).is(':disabled')==false && (dx||dd || judge))){
		console.log('当前题目已选择，下一题');
		setTimeout(()=>{$($('.question-nav>button')[1]).click()},100);
		setTimeout(()=>aianswer(token),200);
	}else{
		console.log('当前题目未选中或者已经是最后一题');
		var text = $('.progress').text() && $('.progress').text().replace(/\s|\n|\r/g,'');
		var question_num = text.match(/第(\d*)?题/) && text.match(/第(\d*)?题/)[1];
		if(question_num==100){
			$('.submit-area>button').click();
            var time = new Date(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDay()+' '+$('.el-statistic__number').text()) - new Date(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDay()+' '+'02:45:00');
			time = time - rd(-30,30)*1000;
            if(time<100){time = 100;}
			console.log('提交倒数计时：'+(time/1000)+'s');
			setTimeout(submit,time);
		}
	}
}
function rd(min,max){return Math.floor(Math.random()*(max-min)+min);}
function submit(){	
	var button_list = $('.el-message-box__btns>button')
    for(var i=0;i<button_list.length;i++){
        var button = $(button_list[i]);
        console.log(button.text());
        if(button.text()=="确定"){
			button.click();
        }
    }
}
